import { defineConfig } from 'vite'
import react from '@vitejs/plugin-react'
import path from 'path'
import { createSvgIconsPlugin } from 'vite-plugin-svg-icons'


export default defineConfig({
  plugins: [
    react(),
    createSvgIconsPlugin({
      iconDirs: [path.resolve(process.cwd(), 'src/assets/icons')],
      symbolId: 'icon-[dir]-[name]',
    }),
  ],
  server: {
    port: 8080,
    open: true,
    cors: true,
  },
  css: {
    preprocessorOptions: {
      less: {
        JavaScriptOutlined: true,
      }
    }
  },
  base: '/',
  resolve: {
    alias: {
      '@': path.resolve(process.cwd(), 'src')
    }
  }
})
